import { createApp } from 'vue'
import App from './App.vue'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import router from './router'
import pinia from './store'
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
//svg插件需要的配置代码
import 'virtual:svg-icons-register'
//注册全局组件
import gloablComponent from './components'
//暗黑模式需要的样式
import 'element-plus/theme-chalk/dark/css-vars.css'
//全局样式
import './styles/index.scss'
//引入路由鉴权文件
import './permisstion'

import VueMarkdownEditor from '@kangc/v-md-editor'
import '@kangc/v-md-editor/lib/style/base-editor.css'
import vuepressTheme from '@kangc/v-md-editor/lib/theme/vuepress.js'
import Prism from 'prismjs'
import VMdPreview from '@kangc/v-md-editor/lib/preview'
import '@kangc/v-md-editor/lib/style/preview.css'
// 引入使用主题的样式
import '@kangc/v-md-editor/lib/theme/style/vuepress.css'

VMdPreview.use(vuepressTheme, {
  Prism,
})

VueMarkdownEditor.use(vuepressTheme, {
  Prism,
})

const app = createApp(App)
//国际化配置
app
  .use(VueMarkdownEditor)
  .use(VMdPreview)
  .use(ElementPlus, {
    locale: zhCn,
  })
  .use(gloablComponent)
  .use(router)
  .use(pinia)
app.mount('#app')
